package zpp_nape.util;
import zpp_nape.Config;
import zpp_nape.Const;
import zpp_nape.util.Flags;
import DummyNapeMain;
import zpp_nape.util.Math;
import zpp_nape.util.Names;
import zpp_nape.util.Pool;
import zpp_nape.shape.Circle;
import zpp_nape.shape.Edge;
import zpp_nape.space.Space;
import zpp_nape.shape.Polygon;
import zpp_nape.shape.Shape;
import zpp_nape.phys.FeatureMix;
import zpp_nape.phys.FluidProperties;
import zpp_nape.phys.Material;
import zpp_nape.phys.Body;
import zpp_nape.geom.AABB;
import zpp_nape.geom.Distance;
import zpp_nape.geom.Mat23;
import zpp_nape.geom.Vec2;
import zpp_nape.geom.VecMath;
import zpp_nape.geom.Collide;
import zpp_nape.dynamics.Arbiter;
import zpp_nape.dynamics.Contact;
import zpp_nape.dynamics.InteractionFilter;
import zpp_nape.constraint.Constraint;
import zpp_nape.dynamics.SpaceArbiterList;
import zpp_nape.constraint.Matrices;
import zpp_nape.constraint.PivotJoint;
import zpp_nape.constraint.WeldJoint;
import nape.util.Flags;
import nape.util.Lists;
import nape.util.Debug;
import nape.space.Space;
import nape.shape.Circle;
import nape.shape.Polygon;
import nape.shape.Edge;
import nape.shape.Shape;
import nape.phys.FluidProperties;
import nape.phys.Material;
import nape.phys.Body;
import nape.geom.AABB;
import nape.geom.Geom;
import nape.geom.Mat23;
import nape.geom.Vec2;
import nape.dynamics.Contact;
import nape.dynamics.Arbiter;
import nape.dynamics.InteractionFilter;

#if swc@:keep#end class ZNPList_ArbiterIterator{
    public var head:ZNPNode_ArbiterIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ArbiterIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ArbiterIterator.zpp_pool==null)new ZNPNode_ArbiterIterator();
                else{
                    var ret=ZNPNode_ArbiterIterator.zpp_pool;
                    ZNPNode_ArbiterIterator.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ArbiterIterator){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ArbiterIterator,o:ArbiterIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ArbiterIterator.zpp_pool==null)new ZNPNode_ArbiterIterator();
                    else{
                        var ret=ZNPNode_ArbiterIterator.zpp_pool;
                        ZNPNode_ArbiterIterator.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ArbiterIterator"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ArbiterIterator.zpp_pool;
            ZNPNode_ArbiterIterator.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ArbiterIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ArbiterIterator):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ArbiterIterator):ZNPNode_ArbiterIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ArbiterIterator"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ArbiterIterator.zpp_pool;
                ZNPNode_ArbiterIterator.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ArbiterIterator,n:Int):ZNPNode_ArbiterIterator{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ArbiterIterator"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ArbiterIterator.zpp_pool;
                    ZNPNode_ArbiterIterator.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ArbiterIterator){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_BodyIterator{
    public var head:ZNPNode_BodyIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:BodyIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_BodyIterator.zpp_pool==null)new ZNPNode_BodyIterator();
                else{
                    var ret=ZNPNode_BodyIterator.zpp_pool;
                    ZNPNode_BodyIterator.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_BodyIterator){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_BodyIterator,o:BodyIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_BodyIterator.zpp_pool==null)new ZNPNode_BodyIterator();
                    else{
                        var ret=ZNPNode_BodyIterator.zpp_pool;
                        ZNPNode_BodyIterator.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_BodyIterator"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_BodyIterator.zpp_pool;
            ZNPNode_BodyIterator.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():BodyIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:BodyIterator):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_BodyIterator):ZNPNode_BodyIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_BodyIterator"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_BodyIterator.zpp_pool;
                ZNPNode_BodyIterator.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_BodyIterator,n:Int):ZNPNode_BodyIterator{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_BodyIterator"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_BodyIterator.zpp_pool;
                    ZNPNode_BodyIterator.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:BodyIterator){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ContactIterator{
    public var head:ZNPNode_ContactIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ContactIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ContactIterator.zpp_pool==null)new ZNPNode_ContactIterator();
                else{
                    var ret=ZNPNode_ContactIterator.zpp_pool;
                    ZNPNode_ContactIterator.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ContactIterator){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ContactIterator,o:ContactIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ContactIterator.zpp_pool==null)new ZNPNode_ContactIterator();
                    else{
                        var ret=ZNPNode_ContactIterator.zpp_pool;
                        ZNPNode_ContactIterator.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ContactIterator"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ContactIterator.zpp_pool;
            ZNPNode_ContactIterator.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ContactIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ContactIterator):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ContactIterator):ZNPNode_ContactIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ContactIterator"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ContactIterator.zpp_pool;
                ZNPNode_ContactIterator.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ContactIterator,n:Int):ZNPNode_ContactIterator{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ContactIterator"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ContactIterator.zpp_pool;
                    ZNPNode_ContactIterator.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ContactIterator){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_EdgeIterator{
    public var head:ZNPNode_EdgeIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:EdgeIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_EdgeIterator.zpp_pool==null)new ZNPNode_EdgeIterator();
                else{
                    var ret=ZNPNode_EdgeIterator.zpp_pool;
                    ZNPNode_EdgeIterator.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_EdgeIterator){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_EdgeIterator,o:EdgeIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_EdgeIterator.zpp_pool==null)new ZNPNode_EdgeIterator();
                    else{
                        var ret=ZNPNode_EdgeIterator.zpp_pool;
                        ZNPNode_EdgeIterator.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_EdgeIterator"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_EdgeIterator.zpp_pool;
            ZNPNode_EdgeIterator.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():EdgeIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:EdgeIterator):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_EdgeIterator):ZNPNode_EdgeIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_EdgeIterator"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_EdgeIterator.zpp_pool;
                ZNPNode_EdgeIterator.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_EdgeIterator,n:Int):ZNPNode_EdgeIterator{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_EdgeIterator"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_EdgeIterator.zpp_pool;
                    ZNPNode_EdgeIterator.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:EdgeIterator){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ShapeIterator{
    public var head:ZNPNode_ShapeIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ShapeIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ShapeIterator.zpp_pool==null)new ZNPNode_ShapeIterator();
                else{
                    var ret=ZNPNode_ShapeIterator.zpp_pool;
                    ZNPNode_ShapeIterator.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ShapeIterator){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ShapeIterator,o:ShapeIterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ShapeIterator.zpp_pool==null)new ZNPNode_ShapeIterator();
                    else{
                        var ret=ZNPNode_ShapeIterator.zpp_pool;
                        ZNPNode_ShapeIterator.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ShapeIterator"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ShapeIterator.zpp_pool;
            ZNPNode_ShapeIterator.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ShapeIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ShapeIterator):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ShapeIterator):ZNPNode_ShapeIterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ShapeIterator"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ShapeIterator.zpp_pool;
                ZNPNode_ShapeIterator.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ShapeIterator,n:Int):ZNPNode_ShapeIterator{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ShapeIterator"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ShapeIterator.zpp_pool;
                    ZNPNode_ShapeIterator.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ShapeIterator){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_Vec2Iterator{
    public var head:ZNPNode_Vec2Iterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:Vec2Iterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_Vec2Iterator.zpp_pool==null)new ZNPNode_Vec2Iterator();
                else{
                    var ret=ZNPNode_Vec2Iterator.zpp_pool;
                    ZNPNode_Vec2Iterator.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_Vec2Iterator){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_Vec2Iterator,o:Vec2Iterator){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_Vec2Iterator.zpp_pool==null)new ZNPNode_Vec2Iterator();
                    else{
                        var ret=ZNPNode_Vec2Iterator.zpp_pool;
                        ZNPNode_Vec2Iterator.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_Vec2Iterator"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_Vec2Iterator.zpp_pool;
            ZNPNode_Vec2Iterator.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():Vec2Iterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:Vec2Iterator):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_Vec2Iterator):ZNPNode_Vec2Iterator{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_Vec2Iterator"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_Vec2Iterator.zpp_pool;
                ZNPNode_Vec2Iterator.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_Vec2Iterator,n:Int):ZNPNode_Vec2Iterator{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_Vec2Iterator"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_Vec2Iterator.zpp_pool;
                    ZNPNode_Vec2Iterator.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:Vec2Iterator){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZDD{
    public var head:ZNPNode_ZDD;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZDD){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZDD.zpp_pool==null)new ZNPNode_ZDD();
                else{
                    var ret=ZNPNode_ZDD.zpp_pool;
                    ZNPNode_ZDD.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZDD){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZDD,o:ZDD){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZDD.zpp_pool==null)new ZNPNode_ZDD();
                    else{
                        var ret=ZNPNode_ZDD.zpp_pool;
                        ZNPNode_ZDD.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZDD"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZDD.zpp_pool;
            ZNPNode_ZDD.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZDD{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZDD):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZDD):ZNPNode_ZDD{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZDD"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZDD.zpp_pool;
                ZNPNode_ZDD.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZDD,n:Int):ZNPNode_ZDD{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZDD"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZDD.zpp_pool;
                    ZNPNode_ZDD.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZDD){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_Arbiter{
    public var head:ZNPNode_ZPP_Arbiter;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_Arbiter){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_Arbiter.zpp_pool==null)new ZNPNode_ZPP_Arbiter();
                else{
                    var ret=ZNPNode_ZPP_Arbiter.zpp_pool;
                    ZNPNode_ZPP_Arbiter.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_Arbiter){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_Arbiter,o:ZPP_Arbiter){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_Arbiter.zpp_pool==null)new ZNPNode_ZPP_Arbiter();
                    else{
                        var ret=ZNPNode_ZPP_Arbiter.zpp_pool;
                        ZNPNode_ZPP_Arbiter.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Arbiter"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_Arbiter.zpp_pool;
            ZNPNode_ZPP_Arbiter.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_Arbiter{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_Arbiter):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_Arbiter):ZNPNode_ZPP_Arbiter{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Arbiter"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_Arbiter.zpp_pool;
                ZNPNode_ZPP_Arbiter.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_Arbiter,n:Int):ZNPNode_ZPP_Arbiter{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Arbiter"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_Arbiter.zpp_pool;
                    ZNPNode_ZPP_Arbiter.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_Arbiter){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_Body{
    public var head:ZNPNode_ZPP_Body;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_Body){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_Body.zpp_pool==null)new ZNPNode_ZPP_Body();
                else{
                    var ret=ZNPNode_ZPP_Body.zpp_pool;
                    ZNPNode_ZPP_Body.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_Body){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_Body,o:ZPP_Body){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_Body.zpp_pool==null)new ZNPNode_ZPP_Body();
                    else{
                        var ret=ZNPNode_ZPP_Body.zpp_pool;
                        ZNPNode_ZPP_Body.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Body"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_Body.zpp_pool;
            ZNPNode_ZPP_Body.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_Body{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_Body):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_Body):ZNPNode_ZPP_Body{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Body"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_Body.zpp_pool;
                ZNPNode_ZPP_Body.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_Body,n:Int):ZNPNode_ZPP_Body{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Body"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_Body.zpp_pool;
                    ZNPNode_ZPP_Body.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_Body){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_Constraint{
    public var head:ZNPNode_ZPP_Constraint;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_Constraint){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_Constraint.zpp_pool==null)new ZNPNode_ZPP_Constraint();
                else{
                    var ret=ZNPNode_ZPP_Constraint.zpp_pool;
                    ZNPNode_ZPP_Constraint.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_Constraint){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_Constraint,o:ZPP_Constraint){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_Constraint.zpp_pool==null)new ZNPNode_ZPP_Constraint();
                    else{
                        var ret=ZNPNode_ZPP_Constraint.zpp_pool;
                        ZNPNode_ZPP_Constraint.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Constraint"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_Constraint.zpp_pool;
            ZNPNode_ZPP_Constraint.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_Constraint{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_Constraint):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_Constraint):ZNPNode_ZPP_Constraint{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Constraint"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_Constraint.zpp_pool;
                ZNPNode_ZPP_Constraint.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_Constraint,n:Int):ZNPNode_ZPP_Constraint{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Constraint"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_Constraint.zpp_pool;
                    ZNPNode_ZPP_Constraint.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_Constraint){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_Edge{
    public var head:ZNPNode_ZPP_Edge;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_Edge){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_Edge.zpp_pool==null)new ZNPNode_ZPP_Edge();
                else{
                    var ret=ZNPNode_ZPP_Edge.zpp_pool;
                    ZNPNode_ZPP_Edge.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_Edge){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_Edge,o:ZPP_Edge){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_Edge.zpp_pool==null)new ZNPNode_ZPP_Edge();
                    else{
                        var ret=ZNPNode_ZPP_Edge.zpp_pool;
                        ZNPNode_ZPP_Edge.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Edge"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_Edge.zpp_pool;
            ZNPNode_ZPP_Edge.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_Edge{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_Edge):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_Edge):ZNPNode_ZPP_Edge{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Edge"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_Edge.zpp_pool;
                ZNPNode_ZPP_Edge.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_Edge,n:Int):ZNPNode_ZPP_Edge{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Edge"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_Edge.zpp_pool;
                    ZNPNode_ZPP_Edge.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_Edge){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_FluidArbiter{
    public var head:ZNPNode_ZPP_FluidArbiter;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_FluidArbiter){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_FluidArbiter.zpp_pool==null)new ZNPNode_ZPP_FluidArbiter();
                else{
                    var ret=ZNPNode_ZPP_FluidArbiter.zpp_pool;
                    ZNPNode_ZPP_FluidArbiter.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_FluidArbiter){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_FluidArbiter,o:ZPP_FluidArbiter){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_FluidArbiter.zpp_pool==null)new ZNPNode_ZPP_FluidArbiter();
                    else{
                        var ret=ZNPNode_ZPP_FluidArbiter.zpp_pool;
                        ZNPNode_ZPP_FluidArbiter.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_FluidArbiter"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_FluidArbiter.zpp_pool;
            ZNPNode_ZPP_FluidArbiter.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_FluidArbiter{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_FluidArbiter):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_FluidArbiter"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_FluidArbiter.zpp_pool;
                ZNPNode_ZPP_FluidArbiter.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_FluidArbiter,n:Int):ZNPNode_ZPP_FluidArbiter{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_FluidArbiter"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_FluidArbiter.zpp_pool;
                    ZNPNode_ZPP_FluidArbiter.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_FluidArbiter){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_SensorArbiter{
    public var head:ZNPNode_ZPP_SensorArbiter;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_SensorArbiter){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_SensorArbiter.zpp_pool==null)new ZNPNode_ZPP_SensorArbiter();
                else{
                    var ret=ZNPNode_ZPP_SensorArbiter.zpp_pool;
                    ZNPNode_ZPP_SensorArbiter.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_SensorArbiter){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_SensorArbiter,o:ZPP_SensorArbiter){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_SensorArbiter.zpp_pool==null)new ZNPNode_ZPP_SensorArbiter();
                    else{
                        var ret=ZNPNode_ZPP_SensorArbiter.zpp_pool;
                        ZNPNode_ZPP_SensorArbiter.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_SensorArbiter"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_SensorArbiter.zpp_pool;
            ZNPNode_ZPP_SensorArbiter.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_SensorArbiter{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_SensorArbiter):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_SensorArbiter"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_SensorArbiter.zpp_pool;
                ZNPNode_ZPP_SensorArbiter.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_SensorArbiter,n:Int):ZNPNode_ZPP_SensorArbiter{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_SensorArbiter"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_SensorArbiter.zpp_pool;
                    ZNPNode_ZPP_SensorArbiter.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_SensorArbiter){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_Shape{
    public var head:ZNPNode_ZPP_Shape;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_Shape){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_Shape.zpp_pool==null)new ZNPNode_ZPP_Shape();
                else{
                    var ret=ZNPNode_ZPP_Shape.zpp_pool;
                    ZNPNode_ZPP_Shape.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_Shape){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_Shape,o:ZPP_Shape){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_Shape.zpp_pool==null)new ZNPNode_ZPP_Shape();
                    else{
                        var ret=ZNPNode_ZPP_Shape.zpp_pool;
                        ZNPNode_ZPP_Shape.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Shape"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_Shape.zpp_pool;
            ZNPNode_ZPP_Shape.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_Shape{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_Shape):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_Shape):ZNPNode_ZPP_Shape{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Shape"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_Shape.zpp_pool;
                ZNPNode_ZPP_Shape.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_Shape,n:Int):ZNPNode_ZPP_Shape{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Shape"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_Shape.zpp_pool;
                    ZNPNode_ZPP_Shape.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_Shape){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZPP_Vec2{
    public var head:ZNPNode_ZPP_Vec2;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZPP_Vec2){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZPP_Vec2.zpp_pool==null)new ZNPNode_ZPP_Vec2();
                else{
                    var ret=ZNPNode_ZPP_Vec2.zpp_pool;
                    ZNPNode_ZPP_Vec2.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZPP_Vec2){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZPP_Vec2,o:ZPP_Vec2){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZPP_Vec2.zpp_pool==null)new ZNPNode_ZPP_Vec2();
                    else{
                        var ret=ZNPNode_ZPP_Vec2.zpp_pool;
                        ZNPNode_ZPP_Vec2.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Vec2"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZPP_Vec2.zpp_pool;
            ZNPNode_ZPP_Vec2.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZPP_Vec2{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZPP_Vec2):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZPP_Vec2):ZNPNode_ZPP_Vec2{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Vec2"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZPP_Vec2.zpp_pool;
                ZNPNode_ZPP_Vec2.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZPP_Vec2,n:Int):ZNPNode_ZPP_Vec2{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZPP_Vec2"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZPP_Vec2.zpp_pool;
                    ZNPNode_ZPP_Vec2.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZPP_Vec2){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}
#if swc@:keep#end class ZNPList_ZSD{
    public var head:ZNPNode_ZSD;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function begin()return head public var modified:Bool;
    public var pushmod:Bool;
    public var mcnt:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function add(o:ZSD){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("add -> "+o);
            #end
        };
        var temp={
            var ret={
                if(ZNPNode_ZSD.zpp_pool==null)new ZNPNode_ZSD();
                else{
                    var ret=ZNPNode_ZSD.zpp_pool;
                    ZNPNode_ZSD.zpp_pool=ret.next;
                    ret;
                }
            };
            ret.elt=o;
            ret;
        };
        temp.next=begin();
        head=temp;
        modified=true;
        mcnt++;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function addAll(x:ZNPList_ZSD){
        {
            #if NAPE_ASSERT var res={
                x!=null;
            };
            if(!res)throw "assert("+"x!=null"+") :: "+("addAll -> "+x);
            #end
        };
        {
            var cx_ite=x.begin();
            while(cx_ite!=null){
                var i=cx_ite.elem();
                add(i);
                cx_ite=cx_ite.next;
            }
        };
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function insert(cur:ZNPNode_ZSD,o:ZSD){
        {
            #if NAPE_ASSERT var res={
                o!=null&&!has(o);
            };
            if(!res)throw "assert("+"o!=null&&!has(o)"+") :: "+("cur -> "+cur+" -> "+o);
            #end
        };
        if(cur==null){
            add(o);
            return begin();
        }
        else{
            var temp={
                var ret={
                    if(ZNPNode_ZSD.zpp_pool==null)new ZNPNode_ZSD();
                    else{
                        var ret=ZNPNode_ZSD.zpp_pool;
                        ZNPNode_ZSD.zpp_pool=ret.next;
                        ret;
                    }
                };
                ret.elt=o;
                ret;
            };
            temp.next=cur.next;
            cur.next=temp;
            pushmod=modified=true;
            mcnt++;
            return temp;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop():Void{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop");
            #end
        };
        var ret=begin();
        head=ret.next;
        {};
        {
            var o=ret;
            {
                #if NAPE_ASSERT var res={
                    o!=null;
                };
                if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZSD"+", in obj: "+"ret"+")");
                #end
            };
            o.free();
            o.next=ZNPNode_ZSD.zpp_pool;
            ZNPNode_ZSD.zpp_pool=o;
        };
        modified=true;
        mcnt--;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function pop_unsafe():ZSD{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("pop_unsafe");
            #end
        };
        var ret=front();
        pop();
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function remove(obj:ZSD):Bool{
        {
            #if NAPE_ASSERT var res={
                obj!=null&&has(obj);
            };
            if(!res)throw "assert("+"obj!=null&&has(obj)"+") :: "+("remove -> "+obj);
            #end
        };
        var pre=null;
        var cur=begin();
        var ret=false;
        while(cur!=null){
            if(cur.elem()==obj){
                erase(pre);
                ret=true;
                break;
            }
            pre=cur;
            cur=cur.next;
        }
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function erase(pre:ZNPNode_ZSD):ZNPNode_ZSD{
        {
            #if NAPE_ASSERT var res={
                !empty();
            };
            if(!res)throw "assert("+"!empty()"+") :: "+("erase -> "+pre);
            #end
        };
        if(pre==null){
            pop();
            return begin();
        }
        else{
            var old=pre.next;
            var cur=old.next;
            pre.next=cur;
            {};
            {
                var o=old;
                {
                    #if NAPE_ASSERT var res={
                        o!=null;
                    };
                    if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZSD"+", in obj: "+"old"+")");
                    #end
                };
                o.free();
                o.next=ZNPNode_ZSD.zpp_pool;
                ZNPNode_ZSD.zpp_pool=o;
            };
            modified=true;
            if(cur==null)pushmod=true;
            mcnt--;
            return cur;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function splice(pre:ZNPNode_ZSD,n:Int):ZNPNode_ZSD{
        while(n-->0&&pre.next!=null)erase(pre);
        return pre.next;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function clear(){
        if(true){
            while(!empty()){
                var old=begin();
                head=old.next;
                {};
                {
                    var o=old;
                    {
                        #if NAPE_ASSERT var res={
                            o!=null;
                        };
                        if(!res)throw "assert("+"o!=null"+") :: "+("Free(in T: "+"ZNPNode_ZSD"+", in obj: "+"old"+")");
                        #end
                    };
                    o.free();
                    o.next=ZNPNode_ZSD.zpp_pool;
                    ZNPNode_ZSD.zpp_pool=o;
                };
                mcnt--;
            }
            modified=true;
            pushmod=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function reverse(){
        var cur=begin();
        var pre=null;
        while(cur!=null){
            var nx=cur.next;
            cur.next=pre;
            head=cur;
            pre=cur;
            cur=nx;
        }
        modified=true;
        pushmod=true;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function empty():Bool return begin()==null#if(flash9&&flib)@:ns("flibdel")#end public inline function size(){
        var cnt=0;
        var cur=begin();
        while(cur!=null){
            cnt++;
            cur=cur.next;
        }
        return cnt;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function has(obj:ZSD){
        {
            #if NAPE_ASSERT var res={
                obj!=null;
            };
            if(!res)throw "assert("+"obj!=null"+") :: "+("has -> "+obj);
            #end
        };
        return({
            var ret=false;
            {
                var cx_ite=this.begin();
                while(cx_ite!=null){
                    var npite=cx_ite.elem();
                    {
                        if(npite==obj){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function front()return begin().elem()#if(flash9&&flib)@:ns("flibdel")#end public inline function back(){
        var ret=begin();
        var cur=ret;
        while(cur!=null){
            ret=cur;
            cur=cur.next;
        }
        return ret.elem();
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function iterator_at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=-1&&ind<size();
            };
            if(!res)throw "assert("+"ind>=-1&&ind<size()"+") :: "+("iterator_at -> "+ind);
            #end
        };
        var ret=begin();
        while(ind-->0&&ret!=null)ret=ret.next;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function at(ind:Int){
        {
            #if NAPE_ASSERT var res={
                ind>=0&&ind<size();
            };
            if(!res)throw "assert("+"ind>=0&&ind<size()"+") :: "+("at -> "+ind);
            #end
        };
        var it=iterator_at(ind);
        return if(it!=null)it.elem()else null;
    }
}

#if swc@:keep#end class ZNPNode_ArbiterIterator{
    static public var zpp_pool:ZNPNode_ArbiterIterator;
    public var next:ZNPNode_ArbiterIterator;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ArbiterIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_BodyIterator{
    static public var zpp_pool:ZNPNode_BodyIterator;
    public var next:ZNPNode_BodyIterator;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:BodyIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ContactIterator{
    static public var zpp_pool:ZNPNode_ContactIterator;
    public var next:ZNPNode_ContactIterator;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ContactIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_EdgeIterator{
    static public var zpp_pool:ZNPNode_EdgeIterator;
    public var next:ZNPNode_EdgeIterator;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:EdgeIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ShapeIterator{
    static public var zpp_pool:ZNPNode_ShapeIterator;
    public var next:ZNPNode_ShapeIterator;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ShapeIterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_Vec2Iterator{
    static public var zpp_pool:ZNPNode_Vec2Iterator;
    public var next:ZNPNode_Vec2Iterator;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:Vec2Iterator;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZDD{
    static public var zpp_pool:ZNPNode_ZDD;
    public var next:ZNPNode_ZDD;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZDD;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_Arbiter{
    static public var zpp_pool:ZNPNode_ZPP_Arbiter;
    public var next:ZNPNode_ZPP_Arbiter;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_Arbiter;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_Body{
    static public var zpp_pool:ZNPNode_ZPP_Body;
    public var next:ZNPNode_ZPP_Body;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_Body;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_Constraint{
    static public var zpp_pool:ZNPNode_ZPP_Constraint;
    public var next:ZNPNode_ZPP_Constraint;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_Constraint;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_Edge{
    static public var zpp_pool:ZNPNode_ZPP_Edge;
    public var next:ZNPNode_ZPP_Edge;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_Edge;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_FluidArbiter{
    static public var zpp_pool:ZNPNode_ZPP_FluidArbiter;
    public var next:ZNPNode_ZPP_FluidArbiter;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_FluidArbiter;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_SensorArbiter{
    static public var zpp_pool:ZNPNode_ZPP_SensorArbiter;
    public var next:ZNPNode_ZPP_SensorArbiter;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_SensorArbiter;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_Shape{
    static public var zpp_pool:ZNPNode_ZPP_Shape;
    public var next:ZNPNode_ZPP_Shape;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_Shape;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZPP_Vec2{
    static public var zpp_pool:ZNPNode_ZPP_Vec2;
    public var next:ZNPNode_ZPP_Vec2;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZPP_Vec2;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}
#if swc@:keep#end class ZNPNode_ZSD{
    static public var zpp_pool:ZNPNode_ZSD;
    public var next:ZNPNode_ZSD;
    #if(flash9&&flib)@:ns("flibdel")#end public inline function free(){
        elt=null;
    }
    public var elt:ZSD;
    public function new(){}
    #if(flash9&&flib)@:ns("flibdel")#end public inline function elem()return elt
}

#if swc@:keep#end class ZPP_MixVec2List extends Vec2List{
    public var inner:ZPP_Vec2;
    public var _length:Int;
    public var zip_length:Bool;
    public var at_ite:ZPP_Vec2;
    public var at_index:Int;
    #if(flash9&&flib)@:ns("flibdel")#end public static inline function get(list:ZPP_Vec2,?immutable=false){
        var ret=new ZPP_MixVec2List();
        ret.inner=list;
        ret.zpp_inner.immutable=immutable;
        return ret;
    }
    public function new(){
        super();
        at_ite=null;
        at_index=0;
        zip_length=true;
        _length=0;
    }
    public inline override function zpp_gl(){
        zpp_vm();
        if(zip_length){
            _length=0;
            {
                var cx_ite=inner.begin();
                while(cx_ite!=null){
                    var i=cx_ite.elem();
                    if(true)_length++;
                    cx_ite=cx_ite.next;
                }
            };
            zip_length=false;
        }
        return _length;
    }
    public inline override function zpp_vm(){
        zpp_inner.validate();
        if(inner.modified){
            if(zpp_inner.iterators!=null){
                {
                    var cx_ite=zpp_inner.iterators.begin();
                    while(cx_ite!=null){
                        var i=cx_ite.elem();
                        {
                            if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour. In this case it appears that you are using api functions that modify this list between hasNext() and next() calls which bypass the usual checks.";
                        };
                        cx_ite=cx_ite.next;
                    }
                };
            }
            zip_length=true;
            _length=0;
            at_ite=null;
        }
    }
    #if swc@:keep#end public inline override function at(index:Int):Vec2{
        zpp_vm();
        if(index<0||index>=length)throw "Error: Index out of bounds";
        if(zpp_inner.reverse_flag)index=length-1-index;
        if(index<at_index||at_ite==null){
            at_index=0;
            at_ite=inner.begin();
            while(true){
                var x=at_ite.elem();
                if(true)break;
                at_ite=at_ite.next;
            }
        }
        while(at_index!=index){
            at_index++;
            at_ite=at_ite.next;
            while(true){
                var x=at_ite.elem();
                if(true)break;
                at_ite=at_ite.next;
            }
        }
        return at_ite.elem().wrapper();
    }
    #if swc@:keep#end public override inline function push(obj:Vec2){
        if(zpp_inner.immutable)throw "Error: "+"Vec2"+"List is immutable";
        zpp_inner.modify_test();
        zpp_vm();
        if(obj.zpp_inner.inuse)throw "Error: "+"Vec2"+" is already in use";
        var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;
        if(cont){
            if(zpp_inner.reverse_flag)inner.add(obj.zpp_inner);
            else{
                var ite=inner.iterator_at(length-1);
                inner.insert(ite,obj.zpp_inner);
            }
            zpp_inner.invalidate();
            if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);
        }
        return cont;
    }
    #if swc@:keep#end public override inline function unshift(obj:Vec2){
        if(zpp_inner.immutable)throw "Error: "+"Vec2"+"List is immutable";
        zpp_inner.modify_test();
        zpp_vm();
        if(obj.zpp_inner.inuse)throw "Error: "+"Vec2"+" is already in use";
        var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;
        if(cont){
            if(zpp_inner.reverse_flag){
                var ite=inner.iterator_at(length-1);
                inner.insert(ite,obj.zpp_inner);
            }
            else inner.add(obj.zpp_inner);
            zpp_inner.invalidate();
            if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);
        }
        return cont;
    }
    #if swc@:keep#end public override inline function pop():Vec2{
        if(zpp_inner.immutable)throw "Error: "+"Vec2"+"List is immutable";
        zpp_inner.modify_test();
        if(empty())throw "Error: Cannot remove from empty list";
        zpp_vm();
        var ret=null;
        if(zpp_inner.reverse_flag){
            ret=inner.front();
            var retx=ret.wrapper();
            if(zpp_inner.subber!=null)zpp_inner.subber(retx);
            inner.pop();
        }
        else{
            if(at_ite!=null&&at_ite.next==null)at_ite=null;
            var ite=length==1?null:inner.iterator_at(length-2);
            ret=ite==null?inner.front():ite.next.elem();
            var retx=ret.wrapper();
            if(zpp_inner.subber!=null)zpp_inner.subber(retx);
            inner.erase(ite);
        }
        zpp_inner.invalidate();
        var retx=ret.wrapper();
        return retx;
    }
    #if swc@:keep#end public override inline function shift():Vec2{
        if(zpp_inner.immutable)throw "Error: "+"Vec2"+"List is immutable";
        zpp_inner.modify_test();
        if(empty())throw "Error: Cannot remove from empty list";
        zpp_vm();
        var ret=null;
        if(zpp_inner.reverse_flag){
            if(at_ite!=null&&at_ite.next==null)at_ite=null;
            var ite=length==1?null:inner.iterator_at(length-2);
            ret=ite==null?inner.front():ite.next.elem();
            var retx=ret.wrapper();
            if(zpp_inner.subber!=null)zpp_inner.subber(retx);
            inner.erase(ite);
        }
        else{
            ret=inner.front();
            var retx=ret.wrapper();
            if(zpp_inner.subber!=null)zpp_inner.subber(retx);
            inner.pop();
        }
        zpp_inner.invalidate();
        var retx=ret.wrapper();
        return retx;
    }
    #if swc@:keep#end public override inline function remove(obj:Vec2):Bool{
        if(zpp_inner.immutable)throw "Error: "+"Vec2"+"List is immutable";
        zpp_inner.modify_test();
        zpp_vm();
        var ret=({
            var ret=false;
            {
                var cx_ite=inner.begin();
                while(cx_ite!=null){
                    var x=cx_ite.elem();
                    {
                        if(obj.zpp_inner==x){
                            ret=true;
                            break;
                        }
                    };
                    cx_ite=cx_ite.next;
                }
            };
            ret;
        });
        if(ret){
            if(zpp_inner.subber!=null)zpp_inner.subber(obj);
            inner.remove(obj.zpp_inner);
            zpp_inner.invalidate();
        }
        return ret;
    }
}

#if swc@:keep#end class ZPP_ArbiterList{
    public var outer:ArbiterList;
    public var inner:ZNPList_ZPP_Arbiter;
    public var immutable:Bool;
    public var _invalidated:Bool;
    public var _invalidate:ZPP_ArbiterList->Dynamic;
    public var _validate:Void->Dynamic;
    public var _modifiable:Void->Dynamic;
    public var iterators:ZNPList_ArbiterIterator;
    public static var internal:Bool=false;
    public var adder:Arbiter->Bool;
    public var post_adder:Arbiter->Dynamic;
    public var subber:Arbiter->Dynamic;
    public var reverse_flag:Bool;
    public static inline function get(list:ZNPList_ZPP_Arbiter,?imm:Bool=false){
        var ret=new ArbiterList();
        ret.zpp_inner.inner=list;
        if(imm)ret.zpp_inner.immutable=true;
        ret.zpp_inner.zip_length=true;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function valmod(){
        validate();
        if(inner.modified){
            if(iterators!=null){
                {
                    var cx_ite=iterators.begin();
                    while(cx_ite!=null){
                        var i=cx_ite.elem();
                        {
                            if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour. In this case it appears that you are using api functions that modify this list between hasNext() and next() calls which bypass the usual checks.";
                        };
                        cx_ite=cx_ite.next;
                    }
                };
            }
            if(inner.pushmod)push_ite=null;
            at_ite=null;
            length+=inner.mcnt;
            inner.modified=false;
            inner.pushmod=false;
            inner.mcnt=0;
            zip_length=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modified(){
        zip_length=true;
        at_ite=null;
        push_ite=null;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modify_test(){
        if(_modifiable!=null)_modifiable();
        if(iterators!=null){
            {
                var cx_ite=iterators.begin();
                while(cx_ite!=null){
                    var i=cx_ite.elem();
                    {
                        if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour";
                    };
                    cx_ite=cx_ite.next;
                }
            };
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function validate(){
        if(_invalidated){
            _invalidated=false;
            if(_validate!=null)_validate();
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function invalidate(){
        _invalidated=true;
        if(_invalidate!=null)_invalidate(this);
    }
    public var at_index:Int;
    public var at_ite:ZNPNode_ZPP_Arbiter;
    public var push_ite:ZNPNode_ZPP_Arbiter;
    public var length:Int;
    public var zip_length:Bool;
    public var user_length:Int;
    public function new(){
        inner=new ZNPList_ZPP_Arbiter();
    }
}
#if swc@:keep#end class ZPP_BodyList{
    public var outer:BodyList;
    public var inner:ZNPList_ZPP_Body;
    public var immutable:Bool;
    public var _invalidated:Bool;
    public var _invalidate:ZPP_BodyList->Dynamic;
    public var _validate:Void->Dynamic;
    public var _modifiable:Void->Dynamic;
    public var iterators:ZNPList_BodyIterator;
    public static var internal:Bool=false;
    public var adder:Body->Bool;
    public var post_adder:Body->Dynamic;
    public var subber:Body->Dynamic;
    public var reverse_flag:Bool;
    public static inline function get(list:ZNPList_ZPP_Body,?imm:Bool=false){
        var ret=new BodyList();
        ret.zpp_inner.inner=list;
        if(imm)ret.zpp_inner.immutable=true;
        ret.zpp_inner.zip_length=true;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function valmod(){
        validate();
        if(inner.modified){
            if(iterators!=null){
                {
                    var cx_ite=iterators.begin();
                    while(cx_ite!=null){
                        var i=cx_ite.elem();
                        {
                            if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour. In this case it appears that you are using api functions that modify this list between hasNext() and next() calls which bypass the usual checks.";
                        };
                        cx_ite=cx_ite.next;
                    }
                };
            }
            if(inner.pushmod)push_ite=null;
            at_ite=null;
            length+=inner.mcnt;
            inner.modified=false;
            inner.pushmod=false;
            inner.mcnt=0;
            zip_length=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modified(){
        zip_length=true;
        at_ite=null;
        push_ite=null;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modify_test(){
        if(_modifiable!=null)_modifiable();
        if(iterators!=null){
            {
                var cx_ite=iterators.begin();
                while(cx_ite!=null){
                    var i=cx_ite.elem();
                    {
                        if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour";
                    };
                    cx_ite=cx_ite.next;
                }
            };
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function validate(){
        if(_invalidated){
            _invalidated=false;
            if(_validate!=null)_validate();
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function invalidate(){
        _invalidated=true;
        if(_invalidate!=null)_invalidate(this);
    }
    public var at_index:Int;
    public var at_ite:ZNPNode_ZPP_Body;
    public var push_ite:ZNPNode_ZPP_Body;
    public var length:Int;
    public var zip_length:Bool;
    public var user_length:Int;
    public function new(){
        inner=new ZNPList_ZPP_Body();
    }
}
#if swc@:keep#end class ZPP_ContactList{
    public var outer:ContactList;
    public var inner:ZPP_Contact;
    public var immutable:Bool;
    public var _invalidated:Bool;
    public var _invalidate:ZPP_ContactList->Dynamic;
    public var _validate:Void->Dynamic;
    public var _modifiable:Void->Dynamic;
    public var iterators:ZNPList_ContactIterator;
    public static var internal:Bool=false;
    public var adder:Contact->Bool;
    public var post_adder:Contact->Dynamic;
    public var subber:Contact->Dynamic;
    public var reverse_flag:Bool;
    public static inline function get(list:ZPP_Contact,?imm:Bool=false){
        var ret=new ContactList();
        ret.zpp_inner.inner=list;
        if(imm)ret.zpp_inner.immutable=true;
        ret.zpp_inner.zip_length=true;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function valmod(){
        validate();
        if(inner.modified){
            if(iterators!=null){
                {
                    var cx_ite=iterators.begin();
                    while(cx_ite!=null){
                        var i=cx_ite.elem();
                        {
                            if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour. In this case it appears that you are using api functions that modify this list between hasNext() and next() calls which bypass the usual checks.";
                        };
                        cx_ite=cx_ite.next;
                    }
                };
            }
            if(inner.pushmod)push_ite=null;
            at_ite=null;
            length+=inner.mcnt;
            inner.modified=false;
            inner.pushmod=false;
            inner.mcnt=0;
            zip_length=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modified(){
        zip_length=true;
        at_ite=null;
        push_ite=null;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modify_test(){
        if(_modifiable!=null)_modifiable();
        if(iterators!=null){
            {
                var cx_ite=iterators.begin();
                while(cx_ite!=null){
                    var i=cx_ite.elem();
                    {
                        if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour";
                    };
                    cx_ite=cx_ite.next;
                }
            };
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function validate(){
        if(_invalidated){
            _invalidated=false;
            if(_validate!=null)_validate();
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function invalidate(){
        _invalidated=true;
        if(_invalidate!=null)_invalidate(this);
    }
    public var at_index:Int;
    public var at_ite:ZPP_Contact;
    public var push_ite:ZPP_Contact;
    public var length:Int;
    public var zip_length:Bool;
    public var user_length:Int;
    public function new(){
        inner=new ZPP_Contact();
    }
}
#if swc@:keep#end class ZPP_EdgeList{
    public var outer:EdgeList;
    public var inner:ZNPList_ZPP_Edge;
    public var immutable:Bool;
    public var _invalidated:Bool;
    public var _invalidate:ZPP_EdgeList->Dynamic;
    public var _validate:Void->Dynamic;
    public var _modifiable:Void->Dynamic;
    public var iterators:ZNPList_EdgeIterator;
    public static var internal:Bool=false;
    public var adder:Edge->Bool;
    public var post_adder:Edge->Dynamic;
    public var subber:Edge->Dynamic;
    public var reverse_flag:Bool;
    public static inline function get(list:ZNPList_ZPP_Edge,?imm:Bool=false){
        var ret=new EdgeList();
        ret.zpp_inner.inner=list;
        if(imm)ret.zpp_inner.immutable=true;
        ret.zpp_inner.zip_length=true;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function valmod(){
        validate();
        if(inner.modified){
            if(iterators!=null){
                {
                    var cx_ite=iterators.begin();
                    while(cx_ite!=null){
                        var i=cx_ite.elem();
                        {
                            if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour. In this case it appears that you are using api functions that modify this list between hasNext() and next() calls which bypass the usual checks.";
                        };
                        cx_ite=cx_ite.next;
                    }
                };
            }
            if(inner.pushmod)push_ite=null;
            at_ite=null;
            length+=inner.mcnt;
            inner.modified=false;
            inner.pushmod=false;
            inner.mcnt=0;
            zip_length=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modified(){
        zip_length=true;
        at_ite=null;
        push_ite=null;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modify_test(){
        if(_modifiable!=null)_modifiable();
        if(iterators!=null){
            {
                var cx_ite=iterators.begin();
                while(cx_ite!=null){
                    var i=cx_ite.elem();
                    {
                        if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour";
                    };
                    cx_ite=cx_ite.next;
                }
            };
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function validate(){
        if(_invalidated){
            _invalidated=false;
            if(_validate!=null)_validate();
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function invalidate(){
        _invalidated=true;
        if(_invalidate!=null)_invalidate(this);
    }
    public var at_index:Int;
    public var at_ite:ZNPNode_ZPP_Edge;
    public var push_ite:ZNPNode_ZPP_Edge;
    public var length:Int;
    public var zip_length:Bool;
    public var user_length:Int;
    public function new(){
        inner=new ZNPList_ZPP_Edge();
    }
}
#if swc@:keep#end class ZPP_ShapeList{
    public var outer:ShapeList;
    public var inner:ZNPList_ZPP_Shape;
    public var immutable:Bool;
    public var _invalidated:Bool;
    public var _invalidate:ZPP_ShapeList->Dynamic;
    public var _validate:Void->Dynamic;
    public var _modifiable:Void->Dynamic;
    public var iterators:ZNPList_ShapeIterator;
    public static var internal:Bool=false;
    public var adder:Shape->Bool;
    public var post_adder:Shape->Dynamic;
    public var subber:Shape->Dynamic;
    public var reverse_flag:Bool;
    public static inline function get(list:ZNPList_ZPP_Shape,?imm:Bool=false){
        var ret=new ShapeList();
        ret.zpp_inner.inner=list;
        if(imm)ret.zpp_inner.immutable=true;
        ret.zpp_inner.zip_length=true;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function valmod(){
        validate();
        if(inner.modified){
            if(iterators!=null){
                {
                    var cx_ite=iterators.begin();
                    while(cx_ite!=null){
                        var i=cx_ite.elem();
                        {
                            if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour. In this case it appears that you are using api functions that modify this list between hasNext() and next() calls which bypass the usual checks.";
                        };
                        cx_ite=cx_ite.next;
                    }
                };
            }
            if(inner.pushmod)push_ite=null;
            at_ite=null;
            length+=inner.mcnt;
            inner.modified=false;
            inner.pushmod=false;
            inner.mcnt=0;
            zip_length=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modified(){
        zip_length=true;
        at_ite=null;
        push_ite=null;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modify_test(){
        if(_modifiable!=null)_modifiable();
        if(iterators!=null){
            {
                var cx_ite=iterators.begin();
                while(cx_ite!=null){
                    var i=cx_ite.elem();
                    {
                        if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour";
                    };
                    cx_ite=cx_ite.next;
                }
            };
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function validate(){
        if(_invalidated){
            _invalidated=false;
            if(_validate!=null)_validate();
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function invalidate(){
        _invalidated=true;
        if(_invalidate!=null)_invalidate(this);
    }
    public var at_index:Int;
    public var at_ite:ZNPNode_ZPP_Shape;
    public var push_ite:ZNPNode_ZPP_Shape;
    public var length:Int;
    public var zip_length:Bool;
    public var user_length:Int;
    public function new(){
        inner=new ZNPList_ZPP_Shape();
    }
}
#if swc@:keep#end class ZPP_Vec2List{
    public var outer:Vec2List;
    public var inner:ZNPList_ZPP_Vec2;
    public var immutable:Bool;
    public var _invalidated:Bool;
    public var _invalidate:ZPP_Vec2List->Dynamic;
    public var _validate:Void->Dynamic;
    public var _modifiable:Void->Dynamic;
    public var iterators:ZNPList_Vec2Iterator;
    public static var internal:Bool=false;
    public var adder:Vec2->Bool;
    public var post_adder:Vec2->Dynamic;
    public var subber:Vec2->Dynamic;
    public var reverse_flag:Bool;
    public static inline function get(list:ZNPList_ZPP_Vec2,?imm:Bool=false){
        var ret=new Vec2List();
        ret.zpp_inner.inner=list;
        if(imm)ret.zpp_inner.immutable=true;
        ret.zpp_inner.zip_length=true;
        return ret;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function valmod(){
        validate();
        if(inner.modified){
            if(iterators!=null){
                {
                    var cx_ite=iterators.begin();
                    while(cx_ite!=null){
                        var i=cx_ite.elem();
                        {
                            if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour. In this case it appears that you are using api functions that modify this list between hasNext() and next() calls which bypass the usual checks.";
                        };
                        cx_ite=cx_ite.next;
                    }
                };
            }
            if(inner.pushmod)push_ite=null;
            at_ite=null;
            length+=inner.mcnt;
            inner.modified=false;
            inner.pushmod=false;
            inner.mcnt=0;
            zip_length=true;
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modified(){
        zip_length=true;
        at_ite=null;
        push_ite=null;
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function modify_test(){
        if(_modifiable!=null)_modifiable();
        if(iterators!=null){
            {
                var cx_ite=iterators.begin();
                while(cx_ite!=null){
                    var i=cx_ite.elem();
                    {
                        if(i.zpp_critical)throw "Error: Lists should never be modified once hasNext() has been called, and before next() has been called on iterators to the list as it is not defined behaviour";
                    };
                    cx_ite=cx_ite.next;
                }
            };
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function validate(){
        if(_invalidated){
            _invalidated=false;
            if(_validate!=null)_validate();
        }
    }
    #if(flash9&&flib)@:ns("flibdel")#end public inline function invalidate(){
        _invalidated=true;
        if(_invalidate!=null)_invalidate(this);
    }
    public var at_index:Int;
    public var at_ite:ZNPNode_ZPP_Vec2;
    public var push_ite:ZNPNode_ZPP_Vec2;
    public var length:Int;
    public var zip_length:Bool;
    public var user_length:Int;
    public function new(){
        inner=new ZNPList_ZPP_Vec2();
    }
}
